package com.shiva.oms.logview.api.model;

import java.io.File;

import com.sf.shiva.oms.common.util.StringUtil;

/**
 * 
 * 描述：
 * 
 * <pre>
 * HISTORY
 * ****************************************************************************
 *  ID    DATE            PERSON            REASON
 *  1     2018年4月21日         YC           Create
 * ****************************************************************************
 * </pre>
 * 
 * @author YC
 * @version 1.0
 */
public class LogFileDirTreeModel {

    private String nodeName;
    private File file;
    private String fileName;

    public LogFileDirTreeModel(File file) {
        this.nodeName = file.getName();
        this.file = file;
    }

    public LogFileDirTreeModel(String fileName) {
        this.nodeName = StringUtil.getLastName(fileName, "/");
        this.fileName = fileName;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }


    @Override
    public String toString() {
        return nodeName;
    }
}
